package com.YHVision.qiuzhike.constant;


/**
 * Redis 常量类
 *
 * @author <a href="">YHVision-小y</a>
 * @from <a href="todo">爱编程学习圈</a>
 */
public class RedisConstant {

    /**
     * 用户签到记录的 Redis Key 前缀
     */
    static String USER_SIGN_IN_REDIS_KEY = "user:signins:";

    static String USER_ACCESS_REDIS_KEY = "user:access:";

    /**
     * 获取用户签到记录的 Redis Key
     *
     *
     * @param loginUserId
     * @return
     */
     public static String getUserAccessRedisKey(long loginUserId) {
        return String.format("%s:%s", USER_SIGN_IN_REDIS_KEY, loginUserId);
    }

    /**
     * 获取用户签到记录的 Redis Key
     *
     * @param year
     * @param userId
     * @return
     */
    public static String getUserSignInRedisKey(int year, long userId) {
        return String.format("%s:%s:%s", USER_SIGN_IN_REDIS_KEY, year, userId);
    }

}
